<div ng-controller="PreopenRecruitCtrl as vm">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-warning">
                <div class="box-header with-border">
                    <h3 class="box-title">Pre-opening Hotels Recruitment Status </h3>
                    <small>(Last Updated: {{vm.lastUpdated | date:'yyyy-MM-dd HH:mm'}} by {{vm.lastUpdateBy}}) </small>
                    <small class="text-warning">{{vm.msg}}</small>
                    <div class="pull-right">
                    <button class="btn btn-danger btn-xs" ng-disabled="vm.loading" ng-click="vm.saveTable()"><i class="fa fa-check-square-o"></i>Save</button>
                    <a class="btn btn-warning btn-xs " ng-href="/api/preopen/export/people/{{vm.hotelId}}">Export</a>

                    </div>
                </div>
                <div class="box-body table-responsive no-padding" style="height: 2000px">
                    <div class="row margin">
                        <div class="col-md-12">
                            <form class="form-horizontal">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Hotel 酒店：</label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" ng-disabled="!vm.editable" ng-model="vm.hotelName">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Holidex Code 酒店代码：</label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" ng-disabled="!vm.editable" ng-model="vm.hotel.hotelCode">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Pre-opening Office Address  筹备开业办公室地址：</label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" ng-disabled="!vm.editable" ng-model="vm.hotel.address">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">No. of Rooms 房间数：</label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" ng-disabled="!vm.editable" ng-model="vm.hotel.roomNo">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Manning Budget 人员编制：</label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" ng-disabled="!vm.editable" ng-model="vm.hotel.manningBudget">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">No. of staff on board as at this month: 截止至本月酒店入职员工总数：</label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" ng-disabled="!vm.editable" ng-model="vm.hotel.staffNo">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Target Opening Date 计划开业日期：</label>
                                        <div class="col-sm-9">
                                        <span class="input-group">
                                          <input type="text" ng-disabled="!vm.editable" class="form-control" uib-datepicker-popup ng-model="vm.targetOpendate" is-open="vm.targetOpendate.opened" datepicker-options="dateOptions"  ng-required="true" close-text="Close"  readonly/>
                                          <span class="input-group-btn">
                                            <button type="button" class="btn btn-default" ng-click="open(vm.targetOpendate,$event)" ><i class="glyphicon glyphicon-calendar"></i></button>
                                          </span>
                                        </span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Date of Opened 实际开业日期：</label>
                                        <div class="col-sm-9">
                                        <span class="input-group">
                                          <input type="text" ng-disabled="!vm.editable" class="form-control" uib-datepicker-popup ng-model="vm.opendate" is-open="vm.opendate.opened" datepicker-options="dateOptions"  ng-required="true" close-text="Close"  readonly/>
                                          <span class="input-group-btn">
                                            <button type="button" class="btn btn-default" ng-click="open(vm.opendate,$event)" ><i class="glyphicon glyphicon-calendar"></i></button>
                                          </span>
                                        </span>
                                    </div>
                                </div>
                                <!-- <div class="form-group">
                                    <label class="col-sm-2 control-label">Updated on:</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" disabled ng-model="vm.lastupdate">
                                    </div>
                                </div> -->
            
                            </form>
                        </div>
                    </div>
                    <table class="table table-hover table-bordered table-condensed">
                        <tr>
                            <th>Position</th>
                           <th>Name</th>
                           <th>Title</th>
                           <th>Contact Number</th>
                           <th>Email Address</th>
                           <th>Internal Transfer/External</th>
                           <th>Candidtate Identified / Confirmed / On-board</th>
                           <th>Date of Commencement</th>
                           <th width="180px">Status</th>
                        </tr>
                        <tr ng-repeat="ret in vm.result">
                            <td>
                                {{ret.position}}
                            </td>
                            <td>
                                <input type="text" class="form-control" ng-disabled="!vm.editable" ng-model="ret.name" />
                            </td>
                            <td>
                                <input type="text" class="form-control" ng-disabled="!vm.editable" ng-model="ret.title" />
                            </td>
                            <td>
                                <input ng-if="ret.position=='GM' || ret.position=='HM/RM/EAM' || ret.position=='FC' || ret.position=='HRD' || ret.position=='Training Manager'" type="text" class="form-control" ng-disabled="!vm.editable" ng-model="ret.phone" />
                                <input ng-if="!(ret.position=='GM' || ret.position=='HM/RM/EAM' || ret.position=='FC' || ret.position=='HRD'|| ret.position=='Training Manager')" type="text" class="form-control" ng-disabled="true" ng-model="ret.phone" />
                            </td>
                            <td>

                                <input ng-if="ret.position=='GM' || ret.position=='HM/RM/EAM' || ret.position=='FC' || ret.position=='HRD'|| ret.position=='Training Manager'" type="text" class="form-control" ng-disabled="!vm.editable" ng-model="ret.email" />
                                <input ng-if="!(ret.position=='GM' || ret.position=='HM/RM/EAM' || ret.position=='FC' || ret.position=='HRD'|| ret.position=='Training Manager')" type="text" class="form-control" ng-disabled="true" ng-model="ret.email" />
                            </td>
                            <td>
                                <select ng-disabled="!vm.editable" class="form-control" ng-options="div for div in vm.typeOptions track by div" ng-model="ret.type">
                                    <option value=''></option>
                      </select>
                            </td>
                            <td>
                                <select ng-disabled="!vm.editable" class="form-control" ng-options="div for div in vm.phaseOptions track by div" ng-model="ret.phase">
                                    <option value=''></option>
                      </select>
                            </td>
                            <td width="150px">
                                <span class="input-group">
                                          <input type="text" ng-disabled="!vm.editable" class="form-control" uib-datepicker-popup ng-model="ret.date" is-open="ret.opened" datepicker-options="dateOptions"  ng-required="true" close-text="Close"  readonly/>
                                          <span class="input-group-btn">
                                            <button type="button" class="btn btn-default" ng-click="open(ret,$event)" ng-disabled="!vm.editable"><i class="glyphicon glyphicon-calendar"></i></button>
                                          </span>
                                </span>
                            </td>
                            <td>
                                <input type="text" ng-disabled="!vm.editable" class="form-control" ng-model="ret.status"/>
                            </td>
                           
                        </tr>
                    </table>
                </div>
                <!-- /.box-body -->
            </div>
            <!-- /.box -->
        </div>
    </div>
</div>
